name_list = ["tom", "lilly", "rose", "tom1"]

print(name_list[-1])
print(name_list[2])

print(name_list.index("tom1"))
print(len(name_list))
print(name_list.count("tom"))

print("tom" in name_list)
print("Tom" in name_list)
print("tom" not in name_list)
name = input("请输入您要找的名字：")
if name in name_list:
    print(f"您输入的名字是{name},名字已存在")
else:
    print(f"您输入的名字{name},名字不存在")

name_list.append("玛卡巴卡")
print(name_list)
name_list.append(["1","2"])
print(name_list)
name_list.extend(["1","2"])
print(name_list)
name_list.extend(["小黑"])
print(name_list)
name_list.extend("小黑")
print(name_list)

name_list.insert(3,"小老弟")
print(name_list)
del name_list
print(name_list)

#pop
print(name_list.pop())
print(name_list)

#remove
name_list.remove("tom")
print(name_list)

#clear
name_list.clear()
print(name_list)

num_list =[1,5,8,9,3,4]
num_list.reverse()
print(num_list)

list1 = reversed(num_list)
print(list1)
list1 = list(list1)
print(list1)
print(num_list)

num_list.sort(reverse=True)
print(num_list)

list1 = sorted(num_list)
print(list1)
print(num_list)

name_list = ["tom", "lilly", "rose", "tom1"]
n=0
while n < len(name_list):
   print(name_list[n])
   n+=1

for name in name_list:
    print(name)

name_list = [['⼩明', '⼩红', '⼩绿'], ['Tom', 'Lily', 'Rose'], ['张三', '李四',
'王五']]

print(name_list[1][2])